$(function(){
    var request = moon.getRequest(location.search); //获取url中"?"符后的参数
    var deviceId = request['deviceId'];  //获取设备deviceId
    $.getJsonData(contextPath +"/device/"+deviceId,{},{type:"Get"}).done(function(data){
        if(data.success){
            var result = data.result;//取数据
            console.log(result);
            $(".device_title").html(result.title);
            $("#deviceId_content").html(result.deviceId);
            $("#deviceUrl").html(window.location.href);
            $("#tags_content").html(result.tags);
            $("#local_content").html(result.local);
            $("#about_content").html(result.about);

            var detailsNode = $(".details");//Id=addSensor的节点  获取节点
            var detailsHref = detailsNode.attr("href");//获取a标签的href
            detailsNode.attr("href",detailsHref+"?deviceId="+deviceId);

        }
    }).fail(function(e){
        console.log(e);
    })
})
